package com.neu.utils.riskReader;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.List;

public class RiskDataListener extends AnalysisEventListener<RiskExcelUtil.RiskData> {

    private final List<RiskExcelUtil.RiskData> riskDataList;

    public RiskDataListener(List<RiskExcelUtil.RiskData> riskDataList) {
        this.riskDataList = riskDataList;
    }

    @Override
    public void invoke(RiskExcelUtil.RiskData riskData, AnalysisContext context) {
        riskDataList.add(riskData);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        // 数据读取完成后的操作（可选）
    }
}

